﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Glorysoft.EAP.Core.Entities
{
    public class TranslateMsg
    {
        public static string ClientLanguage = "EN";

        public TranslateMsg()
        {

        }
        public static Dictionary<string, string> GetTranslation(string msgName)
        {
            Dictionary<string, string> msgs = new Dictionary<string, string>();
            try
            {
                msgs.Add("CN", Messages[msgName].Split(':')[0]);
                msgs.Add("EN", Messages[msgName].Split(':')[1]);

            }
            catch (Exception)
            {
                return msgs;
            }
            return msgs;
        }

        public static Dictionary<string, string> GetTranslation(string msgName, params object?[] args)
        {
            Dictionary<string, string> msgs = new Dictionary<string, string>();
            try
            {
                msgs.Add("CN", string.Format(Messages[msgName].Split(':')[0], args));
                msgs.Add("EN", string.Format(Messages[msgName].Split(':')[1], args));

            }
            catch (Exception)
            {
                return msgs;
            }
            return msgs;
        }
        public static string GetENTranslation(string msgName)
        {
            try
            {
                return Messages[msgName].Split(':')[1];

            }
            catch (Exception)
            {
                return Messages[msgName].Split(':')[0];
            }
        }
        public static string GetCNTranslation(string msgName)
        {

            try
            {
                return Messages[msgName].Split(':')[0];

            }
            catch (Exception)
            {
                return Messages[msgName].Split(':')[0];
            }
        }
        public static Dictionary<string, string> Messages = new Dictionary<string, string>
        {
              #region Login
            {"LoginMESOK","MES>{0},登陆成功.:MES>{0},Login success."},
            {"LoginMESFAIL","MES>{0},登陆失败!{1}.:MES>{0},Login fail!{1}"},
            #endregion
            #region OCR S2F41TrackIn
            {"S2F41TrackInOK","OCR>设置Recipe、LotID成功!:OCR> Set the Recipe、LotID Success!" },
            {"S2F41TrackInNG","OCR>{0}失败!:OCR> {0} to fail" },
             #endregion
             #region OCR S2F41StartTest
            {"S2F41StartTestOK","OCR>开始测试成功!:OCR> Start Test Success!" },
            {"S2F41StartTestNG","OCR>开始测试失败{0}!:OCR> Start Test Fails{0}!" },
             #endregion
             #region OCR CheckNeedlePitch 针距检查
            {"CheckNeedlePitchOK","OCR>针距检查成功!:OCR> The needle spacing check is success!" },
            {"CheckNeedlePitchNG","OCR>针距检查失败，{0}!:OCR>The needle spacing check is failed, {0}" },
             #endregion

             #region OCR CheckNeedleMark 针痕检查
            {"CheckNeedleMarkOK","OCR>针痕检查成功!:OCR> The needle mark was checked success!" },
            {"CheckNeedleMarkNG","OCR>针痕检查失败!:OCR>The needle  mark was checked failed" },
             #endregion

            #region Daemon DownLoadTest 
            {"DownLoadTestOK","Daemon>下载Recipe成功!:Daemon> Download Recipe Success!" },
            {"DownLoadTestNG","Daemon>下载Recipe失败,{0}!:Daemon> Download Recipe failed,{0}" },
             #endregion
             #region  EndTest 
            {"EndTestOK","Daemon>结束测试成功!:Daemon> End Test success!" },
            {"EndTestNG","Daemon>结束测试失败!:Daemon> End Test failed" },
            {"EndTestOKToEAP","OCR>结束测试成功!:OCR> End Test success!" },
            {"EndTestNGToEAP","OCR>结束测试失败!:OCR> End Test failed" },
             #endregion

             #region MES TrackIn 
            {"MESTrackInOK","MES>进站成功!:MES> Track In success!" },
            {"MESTrackInNG","MES>进站失败,{0}!:MES> Track In failed,{0}" },
            {"MESManualTrackIn","MES>批次 {0}, 已手动进站!:MES>LotID {0}, Already Manual Track In!" },
             #endregion

             #region MES TrackOut 
            {"MESTrackOutOK","MES>{0},出站成功!:MES> {0},Track Out success!" },
            {"MESTrackOutNG","MES>{0},出站失败,{1}!:MES> {0},Track Out failed,{1}!" },
            #endregion

             #region Manual Automatic   Operation
            {"ManualOperation","EAP>EAP已切换手动操作!:EAP> The EAP has been switched Manual Operation!" },
            {"AutomaticOperation","EAP>EAP已切换自动操作!:EAP> The EAP has been switched Automatic Operation!" },
            #endregion

            #region SendCommand
            {"SendS2F41TrackIn","EAP>发送S2F41TrackIn命令给OCR!:EAP> Send the S2F41 TrackIn command To OCR" },
            {"SendS2F41_DTS1000_TesterDownloadRecipe","EAP>发送S2F41 TesterDownloadRecipe命令给OCR!:EAP> Send the S2F41 TesterDownloadRecipe command To OCR" },
            {"SendS2F41_UF2000_ProberDownloadRecipe","EAP>发送S2F41 ProberDownloadRecipe命令给OCR!:EAP> Send the S2F41 ProberDownloadRecipe command To OCR" },
            {"SendS2F41StartTest","EAP>发送S2F41StartTest命令OCR!:EAP> Send the S2F41 StartTest command To OCR" },
            {"SendS2F41StartTestToProber","EAP>发送S2F41 StartTest 命令给Prober!:EAP> Send the S2F41 StartTest command To Prober" },
            {"SendS2F41StartTestToTester","EAP>发送S2F41 StartTest 命令给Tester!:EAP> Send the S2F41 StartTest command To Tester" },
            {"SendDownRecipe","EAP>发送下载Recipe信息给Daemon!:EAP> Send download Recipe Message to  Daemon" },
            {"SendEndTest","EAP>发送结束测试信息给Daemon!:EAP> Send the EndTest Message to  Daemon" },
            {"SendS2F41EndTester","EAP>发送结束测试信息给OCR!:EAP> Send the EndTest Message to  OCR" },
            {"SendS2F41DownLoadRecipe","EAP>发送S2F41 DownLoadRecipe 命令OCR!:EAP> Send the S2F41 DownLoadRecipe command To OCR" },
            {"SendS2F41ProberDownLoadRecipe","EAP>发送S2F41 ProberDownLoadRecipe 命令OCR!:EAP> Send the S2F41 ProberDownLoadRecipe command To OCR" },
            {"SendS2F41DownLoadRecipeToTester","OCR>测试机下载Recipe，输入Lot信息成功！:OCR> Tester Downloads the Recipe and Enters the LotID Success!" },
          
            #endregion

            #region
             {"ReceiveS6F11Event","EAP>收到S6F11,{0}事件!:EAP> Receive S6F11,{0} Event!" },
             {"ReceiveS5F1Alarm","EAP>收到S5F1报警!:EAP> Receive S5F1 Alarm!" },
             {"ClearS5F1Alarm","EAP>清除S5F1报警!:EAP> Clear S5F1 Alarm!" },
             {"S6F11TestSuccess","OCR>测试机开始测试成功!:OCR> The Tester Start test success!" },
             {"S6F11EndTestSuccess","OCR>测试机结束测试成功!:OCR> The Tester End test success!" },
             {"S6F11TesterDownloadRecipe","OCR>开始执行Tester:OCR> Send the S2F41 TesterDownloadRecipe command To OCR" },
            #endregion

             #region 发送报警信息给RCM
            {"SendS5F1SetAlarm","EAP>发送S5F1报警消息给RCM!:EAP> Send S5F1 Set Alarm Message to RCM!" },
            {"SendS5F1ClearAlarm","EAP>发送S5F1消除报警消息给RCM!:EAP> Send S5F1 Clear Alarm Message to RCM!" },
            #endregion

            #region 发送状态给 RCM 
             {"SendS6F11EQPStatus","EAP>发送S6F11设备状态-{0}给RCM!:EAP> Send S6F11 EQP Status -{0} to RCM!" },
             {"SendS6F11RemainingTime","EAP>当前设备剩余时间 {0} 分钟!:EAP> The current equipment RemainingTime {0}  minutes" },
             #endregion
             {"ProbeCardValidationOK","EAP> 探卡ID验证成功!:EAP>ProbeCardID Validation is success!" },
             {"S2F41DownLoadRecipeLotInfoIsNull","EAP> 发送给OCR的数据异常，请联系EAP相关人员!:EAP>The Data Send To OCR is Abnormal. Please Contact the EAP Personnel!" },
             #region EAP Monitor
             //绍兴中芯客户要求中文显示
            //{"EAPMonitorRemind","EAP> Please contact the Engineer for machine monitor test! Remind count {0}:请联系工程师进行机台Monitor测试! 提醒次数{0}:" },
            {"EAPMonitorRemind","请MA进行机台Monitor测试! 提醒次数{0}:请MA进行机台Monitor测试! 提醒次数{0}:" },
            {"EAPMonitorLastRemind"," 请MA进行机台Monitor测试! 机台不允许再使用EAP Run货: 请MA进行机台Monitor测试! 机台不允许再使用EAP Run货" },
            {"EAPMonitorRemindOne"," 请MA进行机台Monitor测试! 机台下一批Lot不允许再使用EAP Run货: 请MA进行机台Monitor测试! 机台下一批Lot不允许再使用EAP Run货" },
            {"EAPMonitorRemindThree","EAP> 这是第3次报警，下一批Lot,将不允许再使用EAP Run货:EAP> 这是第3次报警，下一批Lot,将不允许再使用EAP Run货" },
             #endregion
            {"CheckWaferOK","EAP>Wafer比对成功!:EAP>Check Wafer is success!" },
            {"CheckWaferNG","EAP>Wafer比对失败!WaferId是{0},CPMAP文件中PassDie数量为{1},设备实际上报{2},lot hold!:EAP>Check Wafer is fail!waferId {0} is CP MAP count {1},EQP count {2},lot hold!" },
            {"CheckWaferTry","EAP>批次号或批次进站时间或者waferId为空!:EAP> lot or lot trackin time or slidesList is null !" },
            {"CheckWaferCount","EAP>上报Wafer数量和PassDie数量不一致或格式有误!:EAP> wafer count and passdie count is different or format is error!" },
            {"WaferFileisnull","EAP>文件读取有误，批次：{0}，位置：{1}文件数据为空!:EAP> file read error,lotid:{0},slot:{1} file is null!" },
            {"MesError","MES>返回数据异常!:MES> response data error!" },
             {"STARCheckZH","EAP>开始检查人员是否有截取针痕图片!:EAP> Start checking to see if the person has a picture of the intercept needle marks!" },
            {"WaferEndReport","EAP>设备上报WaferId：{0} 测试结束,PassDie数量：{1}:Equipment Report WaferEnd,WaferId：{0},PassDie Count：{1}"},
            {"CheckZHSuccess","EAP>检测到存在针痕图片，上传成功!:EAP> Needle mark image detected. Uploaded successfully!" },
            {"CheckZHFail","EAP>未检测到针痕图片!:EAP> No needle marks were detected!" },
            {"CheckZHErr","EAP>检测到针痕图片异常,请联系管理员!:EAP> Abnormal needle marks have been detected. Please contact the administrator!" },
            {"CheckZHExist","EAP>当前Lot针痕图片已存在，请检查!:EAP> Currently a Lot of needle mark pictures already exist, please check!" },
            {"CheckZHConfigErr","EAP>配置项CheckZHPath或CheckZHUPLOADPath路径不存在，请检查!:EAP> The configuration entry CheckZHPath or CheckZHUPLOADPath path does not exist!" },
             {"LotEnd","EAP>{0}批次已作业结束，开始出站:EAP>{0}LotEnd Received!" },
           
        };
    }
}
